﻿
namespace SvCore.Schedule;

public partial class SvSchedule : ISv
{
    public string Name()
    {
        return nameof(SvSchedule);
    }

    public void Init()
    {
        loger.Debug($"{Name()} Init");

        Core.DictEvt[EvtType.EvTypeSchedule] = Exec;
    }

    public void Run()
    {
        loger.Debug($"{Name()} Run");
        while (true)
        {
            Loop();
            Thread.Sleep(100);
        }
    }

    public void Destroy()
    {
        loger.Debug($"{Name()} Destroy");
    }

    public void Exec(Evt evt)
    {
        ((Action)evt.Data)();
        
    }
}
